#include <head.h>

void * pthread_Func(void *arg)
{
#if 0
    static int retu_1 = 0;
    int * retu_1_p = &retu_1;
    return (void *)retu_1_p;
#elif 0
    int retu_2 =11;
    int * retu_2_p = malloc(sizeof(int *));
    *retu_2_p = retu_2;
    return (void *)retu_2_p;
#elif 1
    int * ptr = (int *)arg;
    *ptr = 12;
    return (void *)ptr;
#endif

}
int main(int argc, char const *argv[])
{
    pthread_t tid = 0;
    int data;
    if(pthread_create(&tid, NULL,pthread_Func,(void *)&data)){
        perror("pthread_create");
        exit(1);
    }
    void *retu;
    pthread_join(tid,&retu);
    printf("retu = %p\n",retu);
    printf("retu = %d\n",*(int *)retu);
    return 0;
}